import React from "react";
import { ActivityIndicator as WeaActivityIndicator } from 'weaver-mobile';
import { When } from "../if";
import './index.less';

export default class ActivityIndicator extends React.Component {
  render() {
    const { loading, size, text } = this.props;

    return (
      <When condition={loading}>
        <div className={'wm-ef-activity-indicator'} >
          <WeaActivityIndicator size={size} text={text} />
        </div>
      </When>
    );
  }
}

ActivityIndicator.defaultProps = {
  loading: true,
  text: 'loading...',
  size: 'large',
};